import type { Equal, Expect } from '@type-challenges/utils'

const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const

type cases = [
  Expect<Equal<TupleToObject<typeof tuple>, { tesla: 'tesla'; 'model 3': 'model 3'; 'model X': 'model X'; 'model Y': 'model Y' }>>,
]

// @ts-expect-error
type error = TupleToObject<[[1, 2], {}]>

//1. typeof 
// type r = typeof tuple
//2. 字面量类型

// let str = "123"
// type s = typeof str
// const strConst = "234"
// type sc = typeof strConst

//3. as const 把数组里的元素都变成一个常量，不可改变


